<?php
	namespace ampleharvest;

	class cConfig
	{
		public $WWW_ROOT_HTDOCS_AMPLEHARVEST = "/AmpleHarvest";
		//The above replaces duplicate: C_STR_AMPLEHARVEST_BASE
		public $WWW_ROOT_PHP_LIB = null;
		
		public $C_STR_COMMON_PATH = null;
		public $C_STR_JS_PATH = null;
		public $C_STR_CSS_PATH = null;
		public $C_STR_EXTERNAL_PATH = null;
		public $C_STR_SOLR_PATH = null;
		public $C_STR_AMPLEHARVEST_CODE = null;
		public $C_STR_IMG_PATH = "/common/img/";
		public $C_STR_EXT4_PATH = "/common/lib/extjs-4.1.1/";
		public $C_STR_JS_BASE = null;
		public $WWW_ROOT_WEB = null;
		public $C_STR_TITLE = "AmpleHarvest";
		
		function __construct(){ 
			
				if (strtoupper(PHP_OS) == "LINUX")
				{
					$this->WWW_ROOT_PHP_LIB = "/var/lib";
					$this->WWW_ROOT_WEB = "/var/www";
					
				}else  //Assume everything else is a flavor of windows for our xampp's.. WINNT
				{
					$this->WWW_ROOT_PHP_LIB = "C:/xampp/php_lib";
					$this->WWW_ROOT_WEB = "C:/xampp/htdocs";
				}
				$this->C_STR_JS_BASE = 		 $this->WWW_ROOT_WEB."/AmpleHarvest";
				$this->C_STR_JS_PATH =       $this->WWW_ROOT_HTDOCS_AMPLEHARVEST."/JS";
				$this->C_STR_CSS_PATH =      $this->WWW_ROOT_HTDOCS_AMPLEHARVEST."/css";
				$this->C_STR_EXTERNAL_PATH = $this->WWW_ROOT_HTDOCS_AMPLEHARVEST."/External";
				$this->C_STR_AMPLEHARVEST_BASE_PAGES_PATH = $this->WWW_ROOT_HTDOCS_AMPLEHARVEST."/AH/pages";
				//above replaces: C_STR_AMPLEHARVEST_BASE_PATH
				
				$this->C_STR_SOLR_PATH =         $this->WWW_ROOT_PHP_LIB."/Solr_Search/";
				$this->C_STR_AMPLEHARVEST_CODE = $this->WWW_ROOT_PHP_LIB."/AmpleHarvest";
		}
		
		const C_STR_HIGHEST_CLASSIFICATION = "UNCLASSIFIED";
		const C_STR_HIGHEST_HANDELING = "";
		
		//Default site load:
		const C_STR_APPLICATION = "AMPLEHARVEST";
		//const C_STR_APPLICATION		= "GROUNDEFFECT";
		//const C_STR_APPLICATION		= "REAPER";
		//const C_STR_APPLICATION		= "GENERALSCARE";
		
		const C_STR_FEEDBACK_URL = "mailto:DLorsomeone@example.com?subject=AmpleHarvest Feedback";
		const C_STR_IRT_FEEDBACK_URL = "mailto:DLorsomeone@example.com?subject=IRT Feedback";

		public static function get_Version()
		{
			$str_FileName = $this->C_STR_AMPLEHARVEST_CODE . "/config/svn_version.txt";
			if (file_exists($str_FileName))
			{
				$str_SVNVersion = file_get_contents($this->C_STR_AMPLEHARVEST_CODE . "/config/svn_version.txt");
			}
			else
			{
				$str_SVNVersion = "X";
			}
			return trim( /*self::C_STR_AH_VERSION.*/$str_SVNVersion);
		}
		
		public function get_Constants()
		{
			$arr_Output = array();
			
			$arr_Output['C_STR_JS_BASE'] = $this->C_STR_JS_BASE;//TODO: is this used?
			$arr_Output['C_STR_HIGHEST_CLASSIFICATION'] = self::C_STR_HIGHEST_CLASSIFICATION;
			$arr_Output['C_STR_HIGHEST_HANDELING'] = self::C_STR_HIGHEST_HANDELING;
			$arr_Output['C_STR_IMG_PATH'] = $this->C_STR_IMG_PATH;
			$arr_Output['C_STR_EXT4_PATH'] = $this->C_STR_EXT4_PATH;
			$arr_Output['C_STR_JS_PATH'] = $this->C_STR_JS_PATH; //TODO: is this used?
			$arr_Output['C_STR_CSS_PATH'] = $this->C_STR_CSS_PATH;
			$arr_Output['C_STR_SOLR_PATH'] = $this->C_STR_SOLR_PATH;
			$arr_Output['C_STR_AMPLEHARVEST_CODE'] = $this->C_STR_AMPLEHARVEST_CODE;
			$arr_Output['C_STR_EXTERNAL_PATH'] = $this->C_STR_EXTERNAL_PATH;
			$arr_Output['C_STR_AMPLEHARVEST_BASE_PAGES_PATH'] = $this->C_STR_AMPLEHARVEST_BASE_PAGES_PATH;
			$arr_Output['WWW_ROOT_HTDOCS_AMPLEHARVEST'] = $this->WWW_ROOT_HTDOCS_AMPLEHARVEST;
			$arr_Output['C_STR_APPLICATION'] = self::C_STR_APPLICATION;
			$arr_Output['C_STR_FEEDBACK_URL'] = self::C_STR_FEEDBACK_URL;
			$arr_Output['C_STR_IRT_FEEDBACK_URL'] = self::C_STR_IRT_FEEDBACK_URL;
			$arr_Output['WWW_ROOT_HTDOCS_AMPLEHARVEST'] = $this->WWW_ROOT_HTDOCS_AMPLEHARVEST;
			
			return $arr_Output;
		}
	}
?>